// IO 函子
import fp from "lodash/fp.js";

class IO {
  static of(value) {
    return new IO(function () {
      return value;
    });
  }
  constructor(fn) {
    this._value = fn;
  }
  map(fn) {
    return new IO(fp.flowRight(fn, this._value));
  }
}

// 调用
let r = IO.of(process).map((p) => p.execPath);
console.log(r);
console.log(r._value());
